import Vue from 'vue';
import Router from 'vue-router';
import  CreatedActive from '../components/page/Active/CreatedActive.vue'
import  Restaurant from '../components/page/Restaurant/Restaurant.vue'
import  Category from '../components/page/Restaurant/Category.vue'
import  Management  from '../components/page/Restaurant/Management .vue'
import  Swiper from '../components/page/Restaurant/Swiper.vue'
import  Recommendation from '../components/page/Restaurant/Recommendation.vue'
import  StoreManagement from '../components/page/Store/StoreManagement.vue'
import  BrandManagement from '../components/page/Brand/BrandManagement.vue'


Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/noviceGuide',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/noviceGuide.vue'),
                    meta: { title: '新手指引步驟' }
                },
                {
                    path: '/table',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                    meta: { title: '活动管理' }
                },
                {
                    path: '/Restaurant',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/Restaurant/Restaurant.vue'),
                    meta: { title: '餐城管理' }
                },
                {
                    path: '/form',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/BaseForm.vue'),
                    meta: { title: '基本表单' }
                },
                {
                    // 富文本编辑器组件
                    path: '/editor',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/VueEditor.vue'),
                    meta: { title: '富文本编辑器' }
                },
                {
                    // markdown组件
                    path: '/markdown',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/page/Markdown.vue'),
                    meta: { title: 'markdown编辑器' }
                },
                {
                    // 图片上传组件
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "upload" */ '../components/page/Upload.vue'),
                    meta: { title: '文件上传' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/a.vue'),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: { title: '拖拽弹框' }
                },
                {
                    // 国际化组件
                    path: '/i18n',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
                    meta: { title: '国际化' }
                },
                {
                    // 权限页面
                    path: '/permission',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Permission.vue'),
                    meta: { title: '权限测试', permission: true }
                },
                {
                    path: '/createdActive',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Active/CreatedActive.vue'),
                    meta: { title: '制定活动' }
                },
                {
                    path: '/activityReport',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Active/ActivityReport.vue'),
                    meta: { title: '活动报表' }
                },
                {
                    path: '/category',
                    component:Category,
                    meta: { title: '分类管理' }
                },
                {
                    path: '/management',
                    component:Management ,
                    meta: { title: '商品管理' }
                },
                {
                    path: '/swiper',
                    component:Swiper,
                    meta: { title: '轮播图管理' }
                },
                {
                    path: '/recommendation',
                    component:Recommendation,
                    meta: { title: '商品推荐' }
                },
                {
                    path: '/brandManagement',
                    component:BrandManagement,
                    meta: { title: '品牌管理' }
                },
                {
                    path: '/areaManagement',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Area/AreaManagement.vue'),
                    meta: { title: '区域管理' }
                },  
                // {
                //     path: '/storeList',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/Store/StoreList.vue'),
                //     meta: { title: '门店列表' }
                // },
                {
                    path: '/storeManagement',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Store/StoreManagement.vue'),
                    meta: { title: '门店管理' }
                },
                {
                    path: '/brandWithdrawal',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/Brand/BrandWithdrawal.vue'),
                    meta: { title: '品牌提现'}
                },
                // {
                //     path: '/userlist',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/admin/index.vue'),
                //     meta: { title: '用户列表' }
                // },
                // {
                //     path: '/roleslist',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/role/index.vue'),
                //     meta: { title: '角色列表' }
                // },
                // {
                //     path: '/menulist',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/menu/index.vue'),
                //     meta: { title: '菜单列表' }
                // },
                // {
                //     path: '/ums/addMenu',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/menu/add.vue'),
                //     meta: { title: '添加菜单' }
                // },
                // {
                //     path: '/ums/allocMenu',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/role/allocMenu.vue'),
                //     meta: { title: '分配菜单' }
                // },
                // {
                //     path: '/ums/updateMenu',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/menu/update.vue'),
                //     meta: { title: '编辑菜单' }
                // },
                // {
                //     path: '/ums/allocResource',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/role/allocResource.vue'),
                //     meta: { title: '分配资源' }
                // },
                // {
                //     path: '/resourceslist',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/resource/index.vue'),
                //     meta: { title: '资源列表' }
                // },
                // {
                //     path: '/ums/resourceCategory',
                //     component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/resource/categoryList.vue'),
                //     meta: { title: '资源分类' }
                // },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }

                
            ]
        },
        {
            path:'/ums',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            redirect: '/ums/userlist',
            name: 'ums',
            meta: {title: '系统管理'},
            children: [
                {
                    path: '/userlist',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/admin/index.vue'),
                    meta: { title: '用户列表' }
                },
                {
                    path: '/roleslist',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/role/index.vue'),
                    meta: { title: '角色列表' }
                },
                {
                    path: '/menulist',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/menu/index.vue'),
                    meta: { title: '菜单列表' }
                },
                {
                    path: '/ums/addMenu',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/menu/add.vue'),
                    meta: { title: '添加菜单' }
                },
                {
                    path: '/allocMenu',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/role/allocMenu.vue'),
                    meta: { title: '分配菜单' }
                },
                {
                    path: '/updateMenu',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/menu/update.vue'),
                    meta: { title: '编辑菜单' }
                },
                {
                    path: '/allocResource',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/ums/role/allocResource.vue'),
                    meta: { title: '分配资源' }
                }

            ]
        } ,

        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
